package com.fishing.service.impl;

import com.spring.util.CustomerContextHolder;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.fishing.entity.Record;
import com.fishing.mapper.RecordMapper;
import com.fishing.service.RecordService;

import java.util.List;

@Service
public class RecordServiceImpl implements RecordService{

    @Resource
    private RecordMapper recordMapper;

    @Override
    public int deleteByPrimaryKey(Long id) {
        return recordMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Record record) {
        return recordMapper.insert(record);
    }

    @Override
    public int insertSelective(Record record) {
        return recordMapper.insertSelective(record);
    }

    @Override
    public Record selectByPrimaryKey(Long id) {
        return recordMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Record record) {
        return recordMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Record record) {
        return recordMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<Record> selectAll(Integer roomId, String startTime, String endTime, Integer pageIndex, Integer pageCount) {
        CustomerContextHolder.setCustomerType(CustomerContextHolder.DATA_SOURCE_SGML);
        return recordMapper.selectAll(roomId,startTime,endTime,pageIndex,pageCount);
    }

    @Override
    public Integer selectCount() {
        return recordMapper.selectCount();
    }


}
